package com.foreknow.entity;

import java.util.ArrayList;
import java.util.List;

public class DeptType {
    //id
    private Integer id;
    //对应属性
    private String name;
    //默认构造器，自动根据id赋值属性
    public DeptType(Integer id){
        this.id = id;
        this.giveName(id);
    }

    private void giveName(Integer id){
        String name;
        switch(id){
            case 1 :
                name = "临床";
                break;
            case 2 :
                name = "医技";
                break;
            case 3 :
                name = "财务";
                break;
            case 4 :
                name = "行政";
                break;
            case 5 :
                name = "其它";
                break;
            default:
                name = "ID有误";
                break;
        }
        this.name = id +"-"+ name;
    }

    public Integer getId() {
        return id;
    }

    public String getName() {
        return name;
    }
    //设置完成的属性集合模型
    public static List<DeptType> getDeptType(){
        List<DeptType> list = new ArrayList<>();
        int name = 5;
        for (int a=1;a<=name;a++){
            list.add(new DeptType(a));
        }
        return list;
    }
}
